CREATE TABLE [dbo].[DnnProduct_Tabs]
(
[TabID] [int] NOT NULL IDENTITY(0, 1),
[TabOrder] [int] NOT NULL CONSTRAINT [DF_DnnProduct_Tabs_TabOrder] DEFAULT ((0)),
[PortalID] [int] NULL,
[TabName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[IsVisible] [bit] NOT NULL CONSTRAINT [DF_DnnProduct_Tabs_IsVisible] DEFAULT ((1)),
[ParentId] [int] NULL,
[IconFile] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DisableLink] [bit] NOT NULL CONSTRAINT [DF_DnnProduct_Tabs_DisableLink] DEFAULT ((0)),
[Title] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Description] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[KeyWords] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IsDeleted] [bit] NOT NULL CONSTRAINT [DF_DnnProduct_Tabs_IsDeleted] DEFAULT ((0)),
[Url] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SkinSrc] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ContainerSrc] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[StartDate] [datetime] NULL,
[EndDate] [datetime] NULL,
[RefreshInterval] [int] NULL,
[PageHeadText] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IsSecure] [bit] NOT NULL CONSTRAINT [DF_DnnProduct_Tabs_IsSecure] DEFAULT ((0)),
[PermanentRedirect] [bit] NOT NULL CONSTRAINT [DF_DnnProduct_Tabs_PermanentRedirect] DEFAULT ((0)),
[SiteMapPriority] [float] NOT NULL CONSTRAINT [DF_DnnProduct_Tabs_SiteMapPriority] DEFAULT ((0.5)),
[CreatedByUserID] [int] NULL,
[CreatedOnDate] [datetime] NULL,
[LastModifiedByUserID] [int] NULL,
[LastModifiedOnDate] [datetime] NULL,
[IconFileLarge] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CultureCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ContentItemID] [int] NULL,
[UniqueId] [uniqueidentifier] NOT NULL CONSTRAINT [DF_DnnProduct_Tabs_Guid] DEFAULT (newid()),
[VersionGuid] [uniqueidentifier] NOT NULL CONSTRAINT [DF_DnnProduct_Tabs_VersionGuid] DEFAULT (newid()),
[DefaultLanguageGuid] [uniqueidentifier] NULL,
[LocalizedVersionGuid] [uniqueidentifier] NOT NULL CONSTRAINT [DF_DnnProduct_Tabs_LocalizedVersionGuid] DEFAULT (newid()),
[Level] [int] NOT NULL CONSTRAINT [DF__DnnProduc__Level__3DFE09A7] DEFAULT ((0)),
[TabPath] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF__DnnProduc__TabPa__3EF22DE0] DEFAULT ('')
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_Tabs] ADD CONSTRAINT [PK_DnnProduct_Tabs] PRIMARY KEY CLUSTERED  ([TabID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_Tabs] ADD CONSTRAINT [IX_DnnProduct_Tabs_UniqueId] UNIQUE NONCLUSTERED  ([UniqueId]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DnnProduct_Tabs_ContentID] ON [dbo].[DnnProduct_Tabs] ([ContentItemID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DnnProduct_Tabs_2] ON [dbo].[DnnProduct_Tabs] ([ParentId]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DnnProduct_Tabs_1] ON [dbo].[DnnProduct_Tabs] ([PortalID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DnnProduct_Tabs_PortalID_ParentID] ON [dbo].[DnnProduct_Tabs] ([PortalID], [ParentId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_Tabs] ADD CONSTRAINT [FK_DnnProduct_Tabs_DnnProduct_ContentItems] FOREIGN KEY ([ContentItemID]) REFERENCES [dbo].[DnnProduct_ContentItems] ([ContentItemID])
GO
ALTER TABLE [dbo].[DnnProduct_Tabs] WITH NOCHECK ADD CONSTRAINT [FK_DnnProduct_Tabs_DnnProduct_Tabs] FOREIGN KEY ([ParentId]) REFERENCES [dbo].[DnnProduct_Tabs] ([TabID]) NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[DnnProduct_Tabs] WITH NOCHECK ADD CONSTRAINT [FK_DnnProduct_Tabs_DnnProduct_Portals] FOREIGN KEY ([PortalID]) REFERENCES [dbo].[DnnProduct_Portals] ([PortalID]) ON DELETE CASCADE NOT FOR REPLICATION
GO
